<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  var arr = ['red','blue','yellow','pink']
  let a = ''
  var b = arr.some(i=>{
    if(i == 'red'){
      a='red'
      return true
    }
  });

  console.log(a)
</script>
</body>
</html>